/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.viettel.bkno.visionone.untils;

import java.math.BigInteger;
import java.security.SecureRandom;

/**
 *
 * @author hien
 */
public class KeyGenerator {
    static KeyGenerator instance = new KeyGenerator();

    private KeyGenerator() {
    }

    public static KeyGenerator getInstance() {
        return instance;
    }
    
    public String genPairkey(){
        // TODO: CAI TIEN THUAT TOAN SINH KEY
        SecureRandom random = new SecureRandom();
        String key =  new BigInteger(32, random).toString(32);
        return key;
    }
    
    public String genSessionKey() {
        String sessionKey = com.sun.xml.ws.security.impl.policy.PolicyUtil.randomUUID();

        // TODO: Request memcached server to check is session key exist?!

        return sessionKey;
} 
}
